<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="/css/main/table.css"/>
<link rel="stylesheet" href="/css/main/page.css"/>
<link rel="stylesheet" href="/css/common/list.css"/>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery-2.1.1.js"></script>
<script type="text/javascript" src="${ctx}/plugin/layer-v1.9.2/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/js/page.js"></script>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery.form.js"></script>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery-validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}/js/task/checkList.js"></script>
<link rel="stylesheet" href="/css/common/add.css"/>
<body>
<div>
    <div class="switch-title">
        <input type="hidden" id="isSpot" value="${isSpot}"/>
        <input type="hidden" id="taskType" value="${taskType}"/>
        <input type="hidden" id="taskId" value="${taskId}"/>
        <input type="hidden" id="dataUrl" value="${url}"/>
        <input type="hidden" id="qnUrl" value="${qnUrl}"/>
        <input type="hidden" id="projectId" value="${task.projectId}"/>
        <button id="inspectList" class="top-button-list">检查项</button>
        <button id="brightSpotList" class="top-button-list">亮点</button>
    </div>
    <div class="check-title">
        <span id="projectName"></span>
    <#if taskType == '1' >
        <#if isSpot == '1' >
            <button id="addCheck" class="top-button-add">添加检查项</button>
        <#else >
            <button id="addBrightStop" class="top-button-add">添加亮点</button>
        </#if>
    </#if>
    </div>
    <div>
        <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid"
               aria-describedby="dynamic-table_info">
            <thead>
            <tr role="row" style=" background: #CDD9D9;" class="tableHead">
            <#if taskType == '1' >
                <th width="10px" tabindex="0" rowspan="1" colspan="1"></th>
            </#if>
            <#if isSpot == '1' >
                <th width="252px" tabindex="0"  rowspan="1" colspan="1">问题库</th>
                <th width="180px" tabindex="0" rowspan="1" colspan="1">检查意见</th>
                <th width="170px" tabindex="0" rowspan="1" colspan="1">
                    <#if taskType == '1' >
                        问题照片
                    </#if>
                    <#if taskType == '2' >
                        问题照片
                    </#if>
                    <#if taskType == '3' >
                        整改意见
                    </#if>
                </th>
                <th width="100px" tabindex="0" rowspan="1" colspan="1">操作</th>
            </#if>
            <#if isSpot == '0' >
                <th width="422px" tabindex="0" rowspan="1" colspan="1">亮点</th>
                <th width="300px" tabindex="0" rowspan="1" colspan="1">问题照片</th>
            </#if>
            </tr>

            </thead>
            <tbody>
            <#list checkList as check>
            <tr role="row" class="odd">
                <#if taskType == '1' >
                    <td>

                        <input type="checkbox" data-id="${check.id}">

                    </td>
                </#if>
                <#if isSpot == '1' >

                    <td style="text-align: left;"><b>

                        <#if check.checkItem??>
                       ${check.checkItem.caption!""}
                    </#if>
                    </b></td>
                </#if>
                <td><b>
                ${check.expressionDesc!""}
                </b></td>
                <td>
                    <#if taskType == '1' >
                        <#if check.fileRecords?? && check.fileRecords?size gt 0>
                        <#--<img src="/common/getCheckImage?path=${check.fileRecords[0].oldPhotoPath!''}" width="50px"-->
                        <#--height="50px"/>-->
                            <#assign n = 0 />
                            <#list check.fileRecords as fileRecord>
                                <#if fileRecord.checkClose>
                                    <#assign n = n+1 />
                                    <#if n gt 3><#break></#if>
                                    <#if fileRecord.oldPhotoPath ?? >
                                <img style="float: left" src="${qnUrl}${fileRecord.oldPhotoPath!''}"
                                     onclick="enlargePhoto(this)"
                                     id="photo${fileRecord.id}" width="50px" height="50px"/>
                                    <#else >
                                      <img style="float: left" src="/images/whitepanel_bg2.png"
                                           onclick="enlargePhoto(this)"
                                           id="photo${fileRecord.id}" width="50px" height="50px"/>
                                    </#if>
                                </#if>
                            </#list>
                        </#if>

                    <#-- <#list  check.fileRecords as fileRecord>

                     </#list>-->
                    </#if>
                    <#if taskType == '2' >
                        <#if check.fileRecords?? && check.fileRecords?size gt 0>
                            <#assign n = 0 />
                            <#list check.fileRecords as fileRecord>
                            <#-- <#if isSpot == '1' >
                                 <#if fileRecord.checkClose>
                                     <#assign n = n+1 />
                                     <#if n gt 1><#break></#if>
                                     <img src="${qnUrl}${fileRecord.oldPhotoPath!''}" onclick="enlargePhoto('${qnUrl}${fileRecord.oldPhotoPath!''}')"  width="50px" height="50px"/>
                                 </#if>
                             <#else>-->
                                <#if fileRecord.checkClose>
                                    <#assign n = n+1 />
                                    <#if n gt 3><#break></#if>
                                    <#--<img src="${qnUrl}${fileRecord.oldPhotoPath!''}"-->
                                         <#--onclick="enlargePhoto(this)" width="50px"-->
                                         <#--height="50px"/>-->
                                    <#if fileRecord.oldPhotoPath ?? >
                                    <img src="${qnUrl}${fileRecord.oldPhotoPath!''}"
                                    onclick="enlargePhoto(this)" width="50px"
                                    height="50px"/>
                                    <#else >
                                      <img src="/images/whitepanel_bg2.png"
                                           onclick="enlargePhoto(this)"
                                          width="50px" height="50px"/>

                                    </#if>
                                </#if>
                            <#--</#if>-->
                            </#list>
                        </#if>
                    </#if>
                    <#if taskType == '3' >
                        <#if isSpot == '1' >
                        ${check.closeMemo!""}
                        <#else >
                            <#if check.fileRecords?? && check.fileRecords?size gt 0>
                                <#assign n = 0 />
                                <#list check.fileRecords as fileRecord>
                                    <#if fileRecord.checkClose>
                                        <#assign n = n+1 />
                                        <#if n gt 3><#break></#if>
                                        <#--<img src="${qnUrl}${fileRecord.oldPhotoPath!''}"-->
                                             <#--onclick="enlargePhoto(this)"-->
                                             <#--width="50px" height="50px"/>-->
                                        <#if fileRecord.oldPhotoPath ?? >
                                    <img src="${qnUrl}${fileRecord.oldPhotoPath!''}"
                                         onclick="enlargePhoto(this)" width="50px"
                                         height="50px"/>
                                        <#else >
                                      <img src="/images/whitepanel_bg2.png"
                                           onclick="enlargePhoto(this)"
                                           width="50px" height="50px"/>

                                        </#if>
                                    </#if>
                                </#list>
                            </#if>
                        </#if>
                    </#if>

                </td>
                <#if isSpot == '1' >
                    <td>
                        <#if taskType == '1' >
                            <a href="javascript:checkDetails('${check.id}')">详情</a>&nbsp;&nbsp;&nbsp;
                            <a href="javascript:scoreCheck('${check.id}',

                                <#if check.checkItem??>
                                      '${check.checkItem.id!""}'
                                  <#else >
                               ''
                                 </#if>
                            )">评分</a>
                        <#--<a href="#">评分</a>-->
                        </#if>
                        <#if taskType == '2' >
                            <#if check.closeMemo??>
                            <#--<span>已整改</span>-->
                                <input class="closeMemo" type="hidden" value="${check.closeMemo}"/>
                            <#else >
                                <input class="closeMemo" type="hidden" value=""/>
                            </#if>
                            <a href="javascript:changeOption('${check.id}')">整改</a>
                        </#if>
                        <#if taskType == '3' >
                            <a href="javascript:checkDetails('${check.id}')">详情</a>&nbsp;&nbsp;&nbsp;
                            <a href="javascript:scoreCheck('${check.id}',

                                <#if check.checkItem??>
                                      '${check.checkItem.id!""}'
                                  <#else >
                               ''
                                 </#if>
                            )">评分</a>
                        </#if>

                    </td>
                </#if>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="row">
        <div class="page-info" id="table_info">
        <#--第${nowBegin}-${nowEnd}条，共${count}条-->
        </div>
    </div>
    <div class="row">
        <div class="page-info" id="table_info">
        <#if taskType == '1' >
            <button id="deleteCheck" class="down-button-re">删除</button>
            <#if personId == task.taskPersonId >
                <button id="setChange" class="down-button-add">开具整改单</button>
            </#if>
        </#if>
        <#if taskType == '2' >
            <button id="changeSubmit" class="down-button-add">整改提交</button>
        </#if>
        <#if taskType == '3' >
            <#if !task.closedLoop>
                <button id="isReturn" class="down-button-re">打回</button>
                <button id="isClose" class="down-button-add">闭环</button>
            </#if>
        </#if>
        </div>
    </div>
   <#-- <div style="display:none" id="changeOption">
        <form id="changeForm" name="form" class="form-horizontal" method="post"
              action="/taskManage/addCheckChange"
              enctype="multipart/form-data">
            <section class="">
                <input type="hidden" id="changeId" name="changeId"/>
                <div class="form-group-div form-layer-input clearfix">
                    <label class="control-label">整改意见：</label>
                    <textarea clos=",50" rows="5" warp="virtual" class="input-medium" id="closeMemo"
                              name="closeMemo"></textarea>
                </div>
                <div class="form-group-div form-layer-input clearfix">
                    <label class="control-label">整改图片：</label>
                &lt;#&ndash;<img id="oldImg0" style="display:none;width:100px;height:100px;" />
                 <img id="oldImg1" style="display:none;width:100px;height:100px;" />
                 <img id="oldImg2" style="display:none;width:100px;height:100px;"/>&ndash;&gt;
                    <input type="file" id="imgFile0" class="input-file-medium" name="imgFile" accept="image/*"/>
                </div>
                <div class="form-group-div form-layer-input clearfix">
                    <label class="control-label">&nbsp;</label>
                    <input type="file" id="imgFile2" class="input-file-medium" name="imgFile2" accept="image/*"/>
                </div>
                <div class="form-group-div form-layer-input clearfix">
                    <label class="control-label">&nbsp;</label>
                    <input type="file" id="imgFile3" class="input-file-medium" name="imgFile3" accept="image/*"/>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" id="submitBtn" class="btn btn-main">提交</button>
                </footer>
            </section>
        </form>
    </div>-->
</div>
</body>
<script type="text/javascript">
    <#--new page({pageMain:"pagination",nowPage:${page!'1'},count:${count},pageSize:${pageSize!'10'},-->
    <#--url:"/admin/user",params:"?pageSize=${pageSize}&query=${query}",pakey:"page"});-->
    if (${isSpot}=='1'
    )
    {
        $("#inspectList").addClass("checkBtn");
    }
    else
    {
        $("#brightSpotList").addClass("checkBtn");
    }
    new tablePage(${page} ,${pageSize} ,${count?c}  , getUul(), getParams());
    function getUul() {
        return '${ctx}/taskManage/checkItem?'
    }
    function getParams() {
        var params = "taskType=" + '${taskType}' + "&taskId=" + '${taskId}' + "&isSpot=" + '${isSpot}';
        return params;
    }
    <#--function lookDetails(id) {-->
    <#--window.open("${ctx}/homepage/getphotoListDetails?projectId="+id);-->
    <#--}-->
</script>
</html>
